<html>
<head><meta charset="utf-8"><title>resolution in the hir_def crate · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html">resolution in the hir_def crate</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219601783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219601783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219601783">(Dec 11 2020 at 12:53)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> I noticed the <a href="http://resolver.rs">resolver.rs</a> and <a href="http://nameres.rs">nameres.rs</a> were in the hir_def crate, whereas I was under the impression that they were done on the CST. So would logically be in, maybe the syntax crate. Can you see the fault in my logic ?</p>



<a name="219601931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219601931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219601931">(Dec 11 2020 at 12:55)</a>:</h4>
<p>I think so</p>



<a name="219601946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219601946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219601946">(Dec 11 2020 at 12:55)</a>:</h4>
<p>We intentionally don't use CST for name resolution</p>



<a name="219601976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219601976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219601976">(Dec 11 2020 at 12:55)</a>:</h4>
<p>The reason for that is that CST is very volatile -- even adding whitespace invalidates CST</p>



<a name="219602069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602069">(Dec 11 2020 at 12:56)</a>:</h4>
<p>So that's why we have that item-tree layer in between, which you've looked at previously -- after typing, we invalidate CST and recmopute item tree</p>



<a name="219602116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602116">(Dec 11 2020 at 12:57)</a>:</h4>
<p>Oh so the CST is only for parsing and then you lower it to hir, to do resolution and type checking?</p>



<a name="219602128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602128">(Dec 11 2020 at 12:57)</a>:</h4>
<p>item tree, however, probably is the same (unless you indeed add new top-level item). So we can skip re-computing name resolution results, as they don't depend on cst directly</p>



<a name="219602132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602132">(Dec 11 2020 at 12:57)</a>:</h4>
<p><span class="user-mention" data-user-id="369769">@kev</span> right!</p>



<a name="219602149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602149">(Dec 11 2020 at 12:57)</a>:</h4>
<p>Also note that the location of those files doesn't necessarily mean that they don't use data structures from a different crate – nameres used to use the CST, but was still in the hir_def crate</p>



<a name="219602266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602266">(Dec 11 2020 at 12:58)</a>:</h4>
<p>Oh right that's a good point</p>



<a name="219602310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602310">(Dec 11 2020 at 12:58)</a>:</h4>
<p>More specificically, the folow is like this:</p>
<div class="codehilite"><pre><span></span><code>text (base_db) -&gt; CST (syntax) -&gt; item_tree (def) -&gt; crate_def_map (def)
                            \---&gt; body (def) -&gt; ty (ty)
</code></pre></div>



<a name="219602559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602559">(Dec 11 2020 at 13:01)</a>:</h4>
<p>Oh I see, the <code>ty</code> probably does not deal with scoping information?</p>



<a name="219602593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602593">(Dec 11 2020 at 13:01)</a>:</h4>
<p><span class="user-mention" data-user-id="369769">@kev</span> there are two kinds of scopes</p>



<a name="219602620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602620">(Dec 11 2020 at 13:01)</a>:</h4>
<p>module-level scope for items. It is handled by <code>crate_def_map</code></p>



<a name="219602688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602688">(Dec 11 2020 at 13:02)</a>:</h4>
<p>block-level scope for local variable. It is handled by <code>body/scope</code> thing, and is pretty ad-hoc</p>



<a name="219602726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602726">(Dec 11 2020 at 13:02)</a>:</h4>
<p>The reson for this split is so that we can resovle names in function bodies lazily</p>



<a name="219602778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602778">(Dec 11 2020 at 13:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="369769">kev</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolution.20in.20the.20hir_def.20crate/near/219602559">said</a>:</p>
<blockquote>
<p>Oh I see, the <code>ty</code> probably does not deal with scoping information?</p>
</blockquote>
<p>Oh, I was referring to lexical scope or block-level scope</p>



<a name="219602854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602854">(Dec 11 2020 at 13:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolution.20in.20the.20hir_def.20crate/near/219602726">said</a>:</p>
<blockquote>
<p>The reson for this split is so that we can resovle names in function bodies lazily</p>
</blockquote>
<p>Hmm what do you mean by resolving names lazily?</p>



<a name="219602857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602857">(Dec 11 2020 at 13:04)</a>:</h4>
<p>Yeah, lexical scopes is handled by <code>ExprScopes</code> which is in <code>def</code> crate, not in <code>ty</code></p>



<a name="219602953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219602953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219602953">(Dec 11 2020 at 13:05)</a>:</h4>
<blockquote>
<p>Hmm what do you mean by resolving names lazily?</p>
</blockquote>
<p>rust-analyzer resolve names in the modules eagarly. That is, after every typing, we recompute the set of names visible in every module.</p>
<p>For function bodies however, we postpone this computation until we actually need it. So typically only bodis in the currently opened  file are processed, all other function bodies are unresolved.</p>



<a name="219603203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219603203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219603203">(Dec 11 2020 at 13:07)</a>:</h4>
<p>Oh right, that makes sense!</p>



<a name="219609213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219609213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219609213">(Dec 11 2020 at 14:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolution.20in.20the.20hir_def.20crate/near/219602310">said</a>:</p>
<blockquote>
<p>More specificically, the folow is like this:</p>
<p><div class="codehilite"><pre><span></span><code>text (base_db) -&gt; CST (syntax) -&gt; item_tree (def) -&gt; crate_def_map (def)
                            \---&gt; body (def) -&gt; ty (ty)
</code></pre></div><br>
</p>
</blockquote>
<p>Are imports resolved before the CST is transformed to body(def) is called?</p>



<a name="219609477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219609477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219609477">(Dec 11 2020 at 14:06)</a>:</h4>
<p>Expressions can be checked with just a Body, so it seems that this must be the case. Link: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/body/scope.rs#L51">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/body/scope.rs#L51</a></p>



<a name="219609850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219609850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219609850">(Dec 11 2020 at 14:10)</a>:</h4>
<p>It uses the name resolution results during body lowering (CrateDefMap)</p>



<a name="219610208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219610208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219610208">(Dec 11 2020 at 14:14)</a>:</h4>
<p>Is there something like api-walkthrough where you can see the whole flow?</p>



<a name="219610278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219610278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219610278">(Dec 11 2020 at 14:14)</a>:</h4>
<p>There probably is, I'm just super blind :)</p>



<a name="219610442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219610442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219610442">(Dec 11 2020 at 14:16)</a>:</h4>
<p>There's a few design docs here: <a href="https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev">https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev</a></p>
<p>I don't think they cover what you're looking for though</p>



<a name="219610701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219610701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219610701">(Dec 11 2020 at 14:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolution.20in.20the.20hir_def.20crate/near/219609850">said</a>:</p>
<blockquote>
<p>It uses the name resolution results during body lowering (CrateDefMap)</p>
</blockquote>
<p>so before the ast::Expr is lowered, it is resolved?</p>



<a name="219610788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219610788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219610788">(Dec 11 2020 at 14:19)</a>:</h4>
<p>I was under the impression that it was lowered first and then resolved</p>



<a name="219611108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219611108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219611108">(Dec 11 2020 at 14:22)</a>:</h4>
<p>Ah, no, seems like only <em>macro calls</em> in the body are really resolved if I'm reading the code correctly</p>



<a name="219611121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219611121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219611121">(Dec 11 2020 at 14:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolution.20in.20the.20hir_def.20crate/near/219610442">said</a>:</p>
<blockquote>
<p>There's a few design docs here: <a href="https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev">https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev</a></p>
<p>I don't think they cover what you're looking for though</p>
</blockquote>
<p>Will re-read the syntax and architecture files incase I missed anything!</p>



<a name="219611270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/resolution%20in%20the%20hir_def%20crate/near/219611270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/resolution.20in.20the.20hir_def.20crate.html#219611270">(Dec 11 2020 at 14:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolution.20in.20the.20hir_def.20crate/near/219611108">said</a>:</p>
<blockquote>
<p>Ah, no, seems like only <em>macro calls</em> in the body are really resolved if I'm reading the code correctly</p>
</blockquote>
<p>This would make a lot of sense for me, because the tests are predominately include macro calls, without any use trees or inlined modules</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>